developmentor - a developer services company				  
				      Essential .NET Security
   Modules

Dumb Code


1. You should filter user input
to protect against purposely malformed input that could cause your system to misbehave
unless you know that your client-side software is already doing the filtering

2. You don't need to worry about buffer overflows in .NET
True, thank goodness all those problems are long gone now that we have IL
False, you can still overflow buffers in Managed C++ and even in C# if you're using pointers

3. Making security decisions based on filenames submitted by a user is
Dangerous, because a single file can have many, many names
Fine as long as you make sure there's no trailing dot on the end of the filename
Fine as long as you make sure to convert it to a long filename first

4. When implementing data access, you should
not worry about security issues if you're in .NET, because code access security will keep you safe.
connect to the database as the database owner, because, well, you own the darn thing!
connect to the database with the least amount of privilege to get your work done
use stored procedures or parameterized queries to keep malformed user input from changing the meaning of your SQL statement
c and d

5. Running with least privilege means
choosing a process identity for your server to grant it just enough permissions to get its job done and no more
connecting to databases using minimal permissions
opening files and other kernel objects for only the permissions you really need
all of the above